package com.ymdd.library.permission;

import android.Manifest;
import android.os.Build;

/**
 * Created by 000286 on 2017/9/21.
 * Description
 */

public final class PermissionArray {

  public static final String[] CALENDAR;
  public static final String[] CAMERA;
  public static final String[] CONTACTS;
  public static final String[] LOCATION;
  //语音
  public static final String[] MICROPHONE;
  public static final String[] PHONE;
  public static final String[] SENSORS;
  public static final String[] SMS;
  public static final String[] STORAGE;
  public static final String[] UNKNOWNAPK;

  static {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
      CALENDAR = new String[] {};
      CAMERA = new String[] {};
      CONTACTS = new String[] {};
      LOCATION = new String[] {};
      MICROPHONE = new String[] {};
      PHONE = new String[] {};
      SENSORS = new String[] {};
      SMS = new String[] {};
      STORAGE = new String[] {};
      UNKNOWNAPK = new String[] {};
    } else {

      CALENDAR = new String[] {
          Manifest.permission.READ_CALENDAR, Manifest.permission.WRITE_CALENDAR
      };

      CAMERA = new String[] { Manifest.permission.CAMERA };

      CONTACTS = new String[] {
          Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_CONTACTS,
          Manifest.permission.GET_ACCOUNTS
      };

      LOCATION = new String[] {
          Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION
      };

      MICROPHONE = new String[] {
          Manifest.permission.RECORD_AUDIO
      };

      PHONE = new String[] {
          Manifest.permission.READ_PHONE_STATE, Manifest.permission.CALL_PHONE
//              ,Manifest.permission.READ_CALL_LOG, Manifest.permission.WRITE_CALL_LOG,
//          Manifest.permission.RECEIVE_WAP_PUSH, Manifest.permission.RECEIVE_MMS
      };

      SENSORS = new String[] { Manifest.permission.BODY_SENSORS };

      SMS = new String[] {
          Manifest.permission.SEND_SMS, Manifest.permission.RECEIVE_SMS,
          Manifest.permission.READ_SMS, Manifest.permission.RECEIVE_WAP_PUSH,
          Manifest.permission.RECEIVE_MMS
      };

      STORAGE = new String[] {
          Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE
      };

      UNKNOWNAPK = new String[]{
          Manifest.permission.REQUEST_INSTALL_PACKAGES
      };
    }
  }
}
